package com.witframework.baseapp.common.basecode;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.javalid.annotations.validation.MaxLength;

import com.witframework.core.annotations.Wit;
import com.witframework.core.structure.BaseWitObject;

@Entity @Table(name="C_CATEGORY") 
@Wit(cnname="分类目录",description="包含分类的目录")
public class Category extends BaseWitObject{
	
	
	@Wit(cnname="名称")
	@Column(length=100,nullable=false)@MaxLength(length=50) 
    private String name;
	
	@Wit(cnname="代码")
	@Column(length=100)@MaxLength(length=50) 
	private String category_code;	
	
    @Wit(cnname="删除状态",description="只能通过设置该状态为YES来逻辑删除")
    @Column(length=1)@MaxLength(length=1)
    String deleted;
   
    
    @Wit(cnname="分类代码列表",description="该目录(大类)下的分类代码列表")

    @OneToMany(mappedBy="category") @LazyCollection(value=LazyCollectionOption.FALSE)
	private List<CategoryCode> categoryCodes;//属性列表
    
    
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}	

	
	public String getDeleted() {
		return deleted;
	}

	public void setDeleted(String deleted) {
		this.deleted = deleted;
	}
	
	public String getCategory_code() {
		return category_code;
	}

	public void setCategory_code(String category_code) {
		this.category_code = category_code;
	}
	
	public List<CategoryCode> getCategoryCodes() {
		return categoryCodes;
	}

	public void setCategoryCodes(List<CategoryCode> categoryCodes) {
		this.categoryCodes = categoryCodes;
	}

	
}
